package main

import (
	"DmsRocketMQ/common"
	csm "DmsRocketMQ/consumer/common"
	"log"
)

func main() {
	cfg, err := common.GetConfig()
	if err != nil {
		log.Printf("%+v", err)
		return
	}
	doneCh := make(chan struct{})
	c, err := csm.GetConsumer(cfg)
	if err != nil {
		log.Printf("%+v", err)
		return
	}
	//订阅主题dmsgo的消息
	err = csm.SubscribeMessage(c, "dmsgo")
	if err != nil {
		log.Printf("%+v", err)
		return
	}
	<-doneCh
	err = c.Shutdown()
	if err != nil {
		log.Printf("%+v", err)
		return
	}
}
